#ifndef NEXPERIA_74AHC595_H
#define NEXPERIA_74AHC595_H
#include <DigitalOut.h>

namespace ti
{
class SN74AHC595
{
public:
    
    SN74AHC595(PinName pin_oe,PinName  pin_srclk,PinName  pin_ser,PinName pin_rclk,uint8_t * digitalValues=nullptr);
    ~SN74AHC595()=default;
    void begin(uint8_t * digitalValues=nullptr);
    void updateRegisters(int size=1);
    void set_oe(bool en);
protected:
    void shift_out( uint8_t bitOrder, uint8_t val);
    //uint8_t shift_in(uint8_t bitOrder);
private:
   
    DigitalOut _oe;  //低电平有效
    DigitalOut _srclk;
    DigitalOut _ser;
    DigitalOut _rclk;  
    uint8_t*  _digitalValues;
    uint8_t _data[1];  

};
};


#endif